<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>编辑模型</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/dist/plugins/webuploader-0.1.5/webuploader.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=f5a12a1d">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style type="text/css">
        select {
            width: 200px;
        }
    </style>
</head>
<body>

<div id="app">

    <div id="h1" style="position:relative; top:30px;left: 10px">
        <span style="font-size:20px;">品牌：</span>
        <select id="testBran" v-model="brandId">
            <option v-for="itemB in itemsBran" v-bind:value="itemB.id">{{itemB.brandName}}</option>
        </select>
        <br><br><br>
        <span style="font-size:20px;"> 机型名称：</span>
        <input type="text" id="modelName" v-model="modelName">
    </div>

    <div id="h2" style="height: 50px;  background-color: #F5F5F5;position:relative; top:80px; ">
        <input type="button" value="提交" @click="update()"
               style="background-color: #1ab7ea;height:30px;width:100px;position:relative;left:75px;">
        <input type="button" value="取消" @click="canclePage()"
               style="background-color:white;height:30px;width:100px;position:relative;left: 110px;">
    </div>


</div>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=63aed32f"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script src="/dist/plugins/webuploader-0.1.5/webuploader.min.js"></script>
<script type="text/javascript" src="/dist/js/pages/apply/money/class.js"></script>
<script type="text/javascript" src="/dist/js/pages/system/systemService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/commonService.js"></script>
<script type="text/javascript" src="/dist/js/pages/common/changeMoneyToChinese.js"></script>
<script type="text/javascript" src="/dist/plugins/print/print.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script type="text/javascript">
    var api = frameElement.api, W = api.opener;
    var vmBrand = new Vue({
        el: '#app',
        data: {
            itemsBran: [],
            brandId: '',
            modelName: '',

        },
        methods: {
            /*点击取消*/
            canclePage(){
                alert("是否取消编辑关闭本页面");
                api.close();
            },
            /*点击提交*/
            update(){
                alert("信息修改完毕是否确认提交");
                var that = this;
                $.wyui.postMethod('/deviceModel/update.json', {
                    id: $.wyui.page.urlParams.id,
                    brandId: this.brandId,
                    modelName: this.modelName,
                    createUser: getCurrentUser().name,
                }, function (r) {
                    console.log(r);
                    if (r.isOk == true) {
                        api.close();
                        location.href = "deviceModel.html";
                    } else {
                        alert("修改失败请重新操作");
                    }
                });


            }


        },
        mounted: function () {
            var that = this;
            $.wyui.postMethod('/deviceBrand/getBrandList.json', {}, function (r) {
                console.log(r);
                that.itemsBran = r.records;
            })


        }
    });


</script>


</body>
</html>